import request from 'lib/request';

// 获取体检报告
export function queryReports(hospitalId, familyId, isFinish) {
   let body = {
    hospitalId,
    familyId,
    isFinish,
  }
  let fId =JSON.parse(localStorage.getItem("auth"+sessionStorage.getItem("hid"))).patientId;
  let hId = JSON.parse(localStorage.getItem("auth"+sessionStorage.getItem("hid"))).hospitalId;
  let isf = 1;
  return request("wechat/eva/list?"+"hospitalId="+hId+"&familyId="+fId+"&isFinish="+isf,{
    method: "GET"
  })
}

// 获取测评报告(微信和app共用的接口)
export function queryReportDetail(type, uid, familyId) {
  let body = {
   uid,
   familyId,
  }
  if(type == "phy" || type == "pre" || type == "partum"){
    return request(`wechat/${type}/reportDetail?`+"uid="+uid+"&familyId="+familyId+"&isHtml="+true,{
      method: "GET",
    })
  }else{
    return request(`wechat/${type}/reportDetail?`+"uid="+uid+"&familyId="+familyId,{
      method: "GET",
    })
  }
}

export function queryPrePreReportDetail(type, uid) {
   let body = {
     uid,
    }
    return request(`wechat/${type}/detail?`+"uid="+uid,{
      method: "GET",
    })
}

